#include<stdio.h>

#define N 5

int main()
{
	int arr1[N] = {1,2,3,4,5};
	int arr2[N] = {6,7,8,9,10};
	int i = 0;
	int* p1 = arr1;
	int* p2 = arr2;
	int temp = 0;
	
	printf("交换前arr1：");
	for(i = 0; i < N; i++)
	{
		printf("%d ",*(p1+i));
	}
	printf("\n");
	
	printf("交换前arr2：");
	for(i = 0; i < N; i++)
	{
		printf("%d ",*(p2+i));
	}
	printf("\n\n");
	
	for(i = 0; i < N; i++)
	{
		temp = *(p1+i);
		*(p1+i) = *(p2+i);
		*(p2+i) = temp;
	}
	
	printf("交换后arr1:");
	for(i = 0; i < N; i++)
	{
		printf("%d ",*(p1+i));
	}
	printf("\n");
	
	printf("交换后arr2:");
	for(i = 0; i < N; i++)
	{
		printf("%d ",*(p2+i));
	}
	printf("\n");
	
	
	return 0;
}
